import java.util.Scanner;

public class AG8 {
    static long N;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        N = scan.nextLong();
        if (N == 1) {
            System.out.println(1);
            return;
        }
        long h = 2,e = 34;
        //算出对应的最小或匹配位置。
        while (h < e) {
            long bottom = (h + e) >> 1;
            long top = bottom >> 1;
            long tmp = C(top, bottom);
            if (tmp > N) {
                e = bottom;
                continue;
            }
            if (tmp < N) {
                h = bottom + 1;
                continue;
            }
            h = e = bottom;
            break;
        }
        //算出匹配位置
        if (C(h, h >> 1) == N) {
            System.out.println(countSite(h, h << 1));
        } else {
            long p = h >> 1, end = -1;
            x: while (p > 0) {
                long h1 = p, e1 = N;
                while (h1 < e1 && p > 1) {
                    long bottom = (h1 + e1) >> 1;
                    long tmp = C(p, bottom);
                    if (tmp > N) {
                        e1 = bottom;
                        continue;
                    }
                    if (tmp < N) {
                        h1 = bottom + 1;
                        continue;
                    }
                    if (tmp == N) {
                        end = bottom;
                        break x;
                    }
                }
                if (p == 1) {
                    end = N;
                    break;
                }
                --p;
            }
            System.out.println(countSite(p, end));
        }
        scan.close();
    }

    public static long C(long top, long bottom) {
        long result = 1;
        if (top > (bottom / 2)) top = bottom - top;
        for (long s = bottom, d = 1; s > bottom - top; --s, ++d) {
            result *= s;
            result /= d;
            if (result > N || result < 0) return result;
        }
        return result;
    }

    public static long countSite(long top, long bottom) {
        return ( ( (bottom + 1) * bottom ) >> 1 ) + top + 1;
    }
}